/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * HttpMDI.java
 *
 * Created on Jan 9, 2009, 12:28:02 PM
 */
package com.google.code.restui;

import javax.swing.UIManager;
import org.jdesktop.application.Action;

/**
 *
 * @author rohit
 */
public class HttpMDI extends javax.swing.JFrame {
    private static final long serialVersionUID = -2408481319302978413L;

    /** Creates new form HttpMDI */
    public HttpMDI() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane1 = new javax.swing.JDesktopPane();
        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(httpui.HttpUIApp.class).getContext().getResourceMap(HttpMDI.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setExtendedState(6);
        setName("Form"); // NOI18N

        jDesktopPane1.setName("jDesktopPane1"); // NOI18N
        getContentPane().add(jDesktopPane1, java.awt.BorderLayout.CENTER);

        jToolBar1.setRollover(true);
        jToolBar1.setName("jToolBar1"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(httpui.HttpUIApp.class).getContext().getActionMap(HttpMDI.class, this);
        jButton1.setAction(actionMap.get("newClient")); // NOI18N
        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setName("jButton1"); // NOI18N
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton1);

        getContentPane().add(jToolBar1, java.awt.BorderLayout.PAGE_START);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception ex) {
            System.out.println("Unable to load native look and feel");
        }
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                HttpMDI httpMdi = new HttpMDI();
                httpMdi.setVisible(true);

                httpMdi.setSize(800, 600);
                httpMdi.setExtendedState(MAXIMIZED_BOTH);

                httpMdi.newClient();

            }
        });
    }

    @Action
    public void newClient() {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                NewTestFrame frame = new NewTestFrame();
                frame.setVisible(true);
                jDesktopPane1.add(frame);
                try {
                    frame.setSelected(true);
                } catch (java.beans.PropertyVetoException e) {
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JToolBar jToolBar1;
    // End of variables declaration//GEN-END:variables
}
